/**
 * Created by Administrator on 2016/12/20.
 */

$(function(){
    init();
});
/****初始化表格数据*******/
function init(){
   // console.log(JSON.parse(localStorage.getItem("contractor")));
  var oData=JSON.parse(localStorage.getItem("contractor"));
    console.log(oData);
    /*  $('#contractorTable').bootstrapTable("load",oData.data);*/
    $('#contractorTable').bootstrapTable({
        data:oData.data.list,
        onClickRow:function(row){
            sessionStorage.realName=row.realName;
        }
    })
}
function responseHandler(res){
    console.log(res);
    var needData = {
        rows: res.data.list,//只 输出data,内容不会显示 在页面内。必须 加上.list;
        total: res.data.total
    };
    return needData;
}
function indexFmt(val,row,index){
    /*if($("table#contractorTable").data('bootstrap.table').options){
        var optionVar=$("table#contractorTable").data('bootstrap.table').options;
        var pageNum=optionVar.pageNumber;
        var pageSize=optionVar.pageSize;
        return (pageNum-1)*pageSize+index+1;
    }else{}
     */
        return index+1;

}

function pjTableQuery(params){
    params["pageNum"] = (params.offset / params.limit) + 1;
    params.pageSize = params.limit;
    return params;

}